﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DotnetWinFormApp
{
    public partial class FTestPathEx : Form
    {
        public FTestPathEx()
        {
            InitializeComponent();
        }

        private void FTestPathEx_Load(object sender, EventArgs e)
        {

        }

        private void btnTest_Click(object sender, EventArgs e)
        {
            char[] invalidFileNameChars = Path.GetInvalidFileNameChars();
            char[] invalidPathChars = Path.GetInvalidPathChars();

            var ret1 = invalidFileNameChars.Intersect(invalidPathChars).ToArray();
            var ret2 = invalidFileNameChars.Union(invalidPathChars).ToArray();

            string str3 = string.Join(string.Empty, invalidFileNameChars);
            string str4 = string.Join(string.Empty, invalidPathChars);

            string str1 = new string(invalidFileNameChars, 0, invalidFileNameChars.Length);
            string str2 = new string(invalidPathChars, 0, invalidPathChars.Length);

            StringBuilder sb = new StringBuilder();
            foreach (var ch in invalidFileNameChars)
            {
                sb.Append(ch);
            }

            StringBuilder sb2 = new StringBuilder();
            foreach (var ch in invalidPathChars)
            {
                sb2.Append(ch);
            }

            string str5 = sb.ToString();
            string str6 = sb2.ToString();
        }
    }
}
